﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.InteropServices;
using System.Data;
using Workflow.Alerts.Utils;
using System.IO;
using System.Xml;
using System.Text;


namespace Workflow.Alerts.Sublayouts
{
    public class InvoiceReport
    {
        public string MunicipalityName { get; set; }

        public void ExportToExcel(DataTable data)
        {
            if (data.Rows.Count == 0) return;

            StringBuilder xmlContent = new StringBuilder();

            var netOperators = data.Select("rowtype=0");
            for (int no = 0; no < netOperators.Length; no++)
            {

                xmlContent.AppendLine(string.Format("<Worksheet ss:Name=\"{0}\">", netOperators[no]["col1"]));
                xmlContent.Append("<Table ss:ExpandedColumnCount=\"10\"  ss:ExpandedRowCount=\"58\" x:FullColumns=\"1\" ");
                xmlContent.AppendLine("x:FullRows=\"1\"  ss:DefaultColumnWidth=\"66\"  ss:DefaultRowHeight=\"15.75\" >");
                xmlContent.AppendLine("<Column ss:Width=\"80\" />");
                xmlContent.AppendLine("<Column ss:Width=\"170\" />");
                xmlContent.AppendLine("<Column ss:Width=\"80\" />");
                xmlContent.AppendLine("<Column ss:Width=\"70\" />");
                xmlContent.AppendLine("<Column ss:Width=\"95\" />");
                xmlContent.AppendLine("<Column ss:Width=\"65\" />");

                FillData(data, xmlContent, netOperators[no]["networkoperatorid"].ToString());

                xmlContent.AppendLine("</Table>");
                xmlContent.AppendLine("<WorksheetOptions xmlns=\"urn:schemas-microsoft-com:office:excel\" >");
                xmlContent.AppendLine("<Print>");
                xmlContent.AppendLine("<ValidPrinterInfo/>");
                xmlContent.AppendLine("<PaperSizeIndex>9</PaperSizeIndex>");
                xmlContent.AppendLine("<HorizontalResolution>-4</HorizontalResolution>");
                xmlContent.AppendLine("<VerticalResolution>-4</VerticalResolution>");
                xmlContent.AppendLine("</Print>");
                xmlContent.AppendLine("<Panes>");
                xmlContent.AppendLine(" <Pane>");
                xmlContent.AppendLine("<Number>3</Number>");
                xmlContent.AppendLine("<ActiveRow>10</ActiveRow>");
                xmlContent.AppendLine("<ActiveCol>3</ActiveCol>");
                xmlContent.AppendLine("<RangeSelection>R1:R1048576</RangeSelection>");
                xmlContent.AppendLine("</Pane>");
                xmlContent.AppendLine("</Panes>");
                xmlContent.AppendLine("<ProtectObjects>False</ProtectObjects>");
                xmlContent.AppendLine("<ProtectScenarios>False</ProtectScenarios>");
                xmlContent.AppendLine("</WorksheetOptions>");
                xmlContent.AppendLine("</Worksheet>");
            }
            xmlContent.AppendLine("</Workbook>");

            var url = String.Format("~/Invoices{0}_{1}.xls", (HttpContext.Current.Session[WorkflowConstants.CurrentUser] as User).MunicipalityId, DateTime.Now.ToString("MMddhh"));
            var path = HttpContext.Current.Server.MapPath(url);

            if (File.Exists(path))
            {
                File.Delete(path);
            }
            string xml = string.Concat(xmlHeader, xmlContent.ToString());
            StreamWriter sw = new StreamWriter(path);
            XmlDocument xdoc = new XmlDocument();
            xdoc.LoadXml(xml);
            sw.Write(xml);
            sw.Flush();
            sw.Close();

            HttpContext.Current.Session["invoiceexport"] = "true";
        }

        private void FillData(DataTable dataTable, StringBuilder xmlContent, string netopeatorid)
        {
            int iRow;
            float alertTotal = 0;
            float netOperatorTotal = 0;

            //first row municipalityname
            xmlContent.AppendLine("<Row>");
            xmlContent.Append(" <Cell ss:MergeAcross=\"3\"  ss:StyleID=\"s85\" ><ss:Data ss:Type=\"String\" ");
            xmlContent.Append("   xmlns=\"http://www.w3.org/TR/REC-html40\" ><B><Font html:Color=\"#000000\" >Gemeente :</Font><Font");
            xmlContent.AppendLine(string.Format("   html:Color=\"#FF0000\" > {0} </Font></B></ss:Data></Cell>",MunicipalityName));
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s85\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s85\" />");            
            xmlContent.AppendLine("</Row>");
            xmlContent.AppendLine("<Row>");
            xmlContent.AppendLine(" <Cell ss:MergeAcross=\"1\"  ss:StyleID=\"s88\" ><Data ss:Type=\"String\" >Factuur opbrekingen netbeheerders</Data></Cell>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s88\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s88\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s88\" />");
            xmlContent.AppendLine("</Row>");
            xmlContent.AppendLine("<Row>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s88\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s88\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s88\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s88\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s88\" />");
            xmlContent.AppendLine("</Row>");

            var netOpDtls = dataTable.Select(string.Format("networkoperatorid={0} AND rowtype=0", netopeatorid));
            if (netOpDtls != null && netOpDtls.Length == 1)
            {
                var dtls = netOpDtls.First();

                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(string.Format(" <Cell ss:MergeAcross=\"1\"  ss:StyleID=\"s90\" ><Data ss:Type=\"String\" >Bedrijfsnaam : {0}</Data></Cell>", dtls[1]));
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>");
                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s90\" ><Data ss:Type=\"String\" >Kenmerk factuur : {0}</Data></Cell>", dtls[0]));
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>");
                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(string.Format(" <Cell ss:MergeAcross=\"1\"  ss:StyleID=\"s90\" ><Data ss:Type=\"String\" >Postbus : {0}</Data></Cell>", dtls[2]));
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>");
                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(string.Format(" <Cell ss:MergeAcross=\"1\"  ss:StyleID=\"s90\" ><Data ss:Type=\"String\" >Postcode : {0}</Data></Cell>\n", dtls[3]));
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>");
                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>");
                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(string.Format(" <Cell ss:MergeAcross=\"1\"  ss:StyleID=\"s90\" ><Data ss:Type=\"String\" >Contactpersoon : {0}</Data></Cell>", dtls[4]));
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>");
                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(string.Format(" <Cell ss:MergeAcross=\"1\"  ss:StyleID=\"s90\" ><Data ss:Type=\"String\" >Mailadres : {0}</Data></Cell>", dtls[5]));
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>");
                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(string.Format(" <Cell ss:MergeAcross=\"1\"  ss:StyleID=\"s90\" ><Data ss:Type=\"String\" >Telefoonnummer : {0}</Data></Cell>", dtls[6]));
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>\n");
                xmlContent.AppendLine("<Row ss:Height=\"16.5\" >\n");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
                xmlContent.AppendLine("</Row>");
            }

            //create table header

            xmlContent.AppendLine("<Row ss:Height=\"16.5\" >");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s91\" ><Data ss:Type=\"String\" >Code</Data></Cell>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s92\" ><Data ss:Type=\"String\" >Locatie </Data></Cell>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s93\" ><Data ss:Type=\"String\" >Opgeleverd</Data></Cell>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s92\" ><Data ss:Type=\"String\" >Activiteit</Data></Cell>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s94\" ><Data ss:Type=\"String\" >Tarief</Data></Cell>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s95\" ><Data ss:Type=\"String\" >Factuurbedrag</Data></Cell>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s76\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s76\" />");
            xmlContent.AppendLine(" <Cell ss:Index=\"10\"  ss:StyleID=\"s76\" />");
            xmlContent.AppendLine("</Row>");
            xmlContent.AppendLine("<Row>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s96\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s96\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s96\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s96\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s96\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s96\" />");
            xmlContent.AppendLine("</Row>");

            //fill alerts

            var alerts = dataTable.Select(string.Format("networkoperatorid={0} AND rowtype=1", netopeatorid));
            iRow = 15;
            foreach (var alert in alerts)
            {
                alertTotal = 0; //clear counter
                iRow += 1;

                //write header of alert

                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s97\" ><Data ss:Type=\"String\" >{0}</Data></Cell>", alert[2]));
                xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s83\" ><Data ss:Type=\"String\" >{0}</Data></Cell>", alert[3]));
                xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s98\" ><Data ss:Type=\"String\" >{0}</Data></Cell>", alert[1]));
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s99\" ><Data ss:Type=\"String\" >Leges</Data></Cell>");
                xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s101\" ><Data ss:Type=\"String\" >{0}</Data></Cell>", alert[5]));
                xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s101\" ><Data ss:Type=\"String\" >{0}</Data></Cell>", alert[5]));
                xmlContent.AppendLine("</Row>");

                alertTotal = (float)Double.Parse(alert[5].ToString());

                var materials = dataTable.Select(string.Format("alertid={0} AND rowtype=2", alert[0]));
                foreach (var material in materials)
                {
                    iRow += 1;

                    xmlContent.AppendLine("<Row>");
                    xmlContent.AppendLine(" <Cell ss:StyleID=\"s102\" />");
                    xmlContent.AppendLine(" <Cell ss:StyleID=\"s103\" />");
                    xmlContent.AppendLine(" <Cell ss:StyleID=\"s104\" />");
                    xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s103\" ><Data ss:Type=\"String\" >{0}</Data></Cell>", material[2]));
                    xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s106\" ><Data ss:Type=\"Number\" >{0}</Data></Cell>", material[4]));
                    xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s106\" ><Data ss:Type=\"Number\" >{0}</Data></Cell>", material[5]));
                    xmlContent.AppendLine("</Row>");

                    alertTotal += (float)Double.Parse(material[5].ToString());
                }
                //draw footer per alert
                iRow += 1;

                xmlContent.AppendLine("<Row>");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s108\" />");
                xmlContent.AppendLine(" <Cell ss:StyleID=\"s109\" />");
                xmlContent.AppendLine(string.Format(" <Cell ss:MergeAcross=\"2\"  ss:StyleID=\"s119\" ><Data ss:Type=\"String\" >Totaal opbreking {0}</Data></Cell>", alert[2]));
                xmlContent.AppendLine(string.Format(" <Cell ss:StyleID=\"s111\"><Data ss:Type=\"Number\" >{0}</Data></Cell>", alertTotal));
                xmlContent.AppendLine("</Row>");
                netOperatorTotal += alertTotal;
            }

            //draw footer per Network operator

            xmlContent.AppendLine("<Row>");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s104\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s104\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s104\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s104\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s105\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s105\" />");
            xmlContent.AppendLine("</Row>");
            xmlContent.AppendLine("<Row ss:Height=\"16.5\" >");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s104\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s104\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s104\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s87\" />");
            xmlContent.AppendLine(" <Cell ss:StyleID=\"s114\" ><Data ss:Type=\"String\" >Totaal factuurbedrag</Data></Cell>");
            xmlContent.Append(" <Cell ss:StyleID=\"s115\" ><Data");
            xmlContent.AppendLine(string.Format(" ss:Type=\"Number\" >{0}</Data></Cell>", netOperatorTotal));
            xmlContent.AppendLine("</Row>");
        }
        #region Xml Header
        private string xmlHeader = "<?xml version=\"1.0\" ?>\n" +
"<?mso-application progid=\"Excel.Sheet\" ?>\n" +
"<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" " +
" xmlns:o=\"urn:schemas-microsoft-com:office:office\" " +
" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" " +
" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" " +
" xmlns:html=\"http://www.w3.org/TR/REC-html40\" >\n" +
"<DocumentProperties xmlns=\"urn:schemas-microsoft-com:office:office\" >\n" +
"<Author>Maarten Rempkens</Author>\n" +
"<LastAuthor>alex</LastAuthor>\n" +
"<LastPrinted>2011-03-29T09:34:58Z</LastPrinted>\n" +
"<Created>2011-03-28T14:18:47Z</Created>\n" +
"<LastSaved>2011-03-31T10:12:38Z</LastSaved>\n" +
"<Company>Terra Incognita advies kabels en leidingen</Company>\n" +
"<Version>14.00</Version>\n" +
"</DocumentProperties>\n" +
"<OfficeDocumentSettings xmlns=\"urn:schemas-microsoft-com:office:office\" >\n" +
"<AllowPNG/>\n" +
"</OfficeDocumentSettings>\n" +
"<ExcelWorkbook xmlns=\"urn:schemas-microsoft-com:office:excel\" >\n" +
"<WindowHeight>15600</WindowHeight>\n" +
"<WindowWidth>25440</WindowWidth>\n" +
"<WindowTopX>20100</WindowTopX>\n" +
"<WindowTopY>5625</WindowTopY>\n" +
"<TabRatio>500</TabRatio>\n" +
"<ActiveSheet>1</ActiveSheet>\n" +
"<ProtectStructure>False</ProtectStructure>\n" +
"<ProtectWindows>False</ProtectWindows>\n" +
"<DisplayInkNotes>False</DisplayInkNotes>\n" +
"</ExcelWorkbook>\n" +
"<Styles>\n" +
"<Style ss:ID=\"Default\"  ss:Name=\"Normal\" >\n" +
"<Alignment ss:Vertical=\"Bottom\" />\n" +
"<Borders/>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Size=\"12\"  ss:Color=\"#000000\" />\n" +
"<Interior/>\n" +
"<NumberFormat/>\n" +
"<Protection/>\n" +
"</Style>\n" +
"<Style ss:ID=\"s76\" >\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Size=\"12\"  ss:Color=\"#000000\" " +
" ss:Bold=\"1\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s77\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s78\" >\n" +
"<NumberFormat ss:Format=\"#,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s79\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\#,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s80\" >\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\ #,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s81\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders/>\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\ #,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s82\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders/>\n" +
"</Style>\n" +
"<Style ss:ID=\"s83\" >\n" +
"<Alignment ss:Horizontal=\"Left\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\" />\n" +
"<Interior/>\n" +
"<NumberFormat/>\n" +
"<Protection/>\n" +
"</Style>\n" +
"<Style ss:ID=\"s85\" >\n" +
"<Alignment ss:Vertical=\"Bottom\" />\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s87\" >\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s88\" >\n" +
"<Alignment ss:Horizontal=\"Left\"  ss:Vertical=\"Bottom\" />\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s90\" >\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#FF0000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s91\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Left\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s92\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Left\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Right\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s93\" >\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s94\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s95\" >\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Right\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"2\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s96\" >\n" +
"<Borders/>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s97\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Left\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Arial\" x:Family=\"Swiss\" />\n" +
"<Interior/>\n" +
"<NumberFormat/>\n" +
"<Protection/>\n" +
"</Style>\n" +
"<Style ss:ID=\"s98\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"<NumberFormat ss:Format=\"Short Date\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s99\" >\n" +
"<Alignment ss:Horizontal=\"Left\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s100\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\#,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s101\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Right\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\ #,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s102\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Left\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s103\" >\n" +
"<Alignment ss:Horizontal=\"Left\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders/>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s104\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders/>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s105\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders/>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\#,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s106\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Right\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\ #,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s107\" >\n" +
"<Alignment ss:Horizontal=\"Left\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders/>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"<Interior/>\n" +
"</Style>\n" +
"<Style ss:ID=\"s108\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
" <Border ss:Position=\"Left\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s109\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s111\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
" <Border ss:Position=\"Right\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"<Interior ss:Color=\"#D9D9D9\"  ss:Pattern=\"Solid\" />\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\ #,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s112\" >\n" +
"<Alignment ss:Horizontal=\"Left\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s113\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Left\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
" <Border ss:Position=\"Top\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s114\" >\n" +
"<Alignment ss:Horizontal=\"Right\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders/>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\" />\n" +
"<Interior/>\n" +
"</Style>\n" +
"<Style ss:ID=\"s115\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Double\"  ss:Weight=\"3\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"<NumberFormat ss:Format=\"&quot;€&quot;\\ #,##0.00_-\" />\n" +
"</Style>\n" +
"<Style ss:ID=\"s119\" >\n" +
"<Alignment ss:Horizontal=\"Center\"  ss:Vertical=\"Bottom\" />\n" +
"<Borders>\n" +
" <Border ss:Position=\"Bottom\"  ss:LineStyle=\"Continuous\"  ss:Weight=\"1\" />\n" +
"</Borders>\n" +
"<Font ss:FontName=\"Calibri\" x:Family=\"Swiss\"  ss:Color=\"#000000\"  ss:Bold=\"1\" />\n" +
"<Interior ss:Color=\"#D9D9D9\"  ss:Pattern=\"Solid\" />\n" +
"</Style>\n" +
"</Styles>\n";
        #endregion
    }
}
